
import React, { Component } from "./lib/react"
import ReactDOM from "./lib/react-dom"

// class Menu extends React.Component {
//   render() {
//     return <h1>menu {this.props.title}</h1>
//   }
// }

function Menu(props) {
  return <h1>menu {props.title}</h1>
}
//class App extends React.Component
class App extends Component {
  constructor(props) {
    super(props)
    this.state = {
      title: 'jirengu'
    }
  }
  
  
  handleClick() {
    this.setState({
      title: 'haha'
    })
  }


  render() {
    return (
      <div>
        <Menu title={this.state.title}></Menu>
        <h1>{ this.state.title }</h1>
        <p>{ this.props.id }</p>
        <span onClick={this.handleClick.bind(this)}>hello</span>
      </div>
    )
  }    
  
}


ReactDOM.render((
  <App id="app">hello</App>
), document.body)